unit SmallStruct.Error;

interface

uses SysUtils;

type
  ESSException = class(Exception)
  end;

  ESSOperationException = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName, AErrorMessage: string);
  end;

  ESSClassNotFound = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName, AClassName: string);
  end;

  ESSClassExists = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName, AClassName: string);
  end;

  ESSConfigurationNotFound = class(ESSException)
  public
    constructor Create(const AConfigurationName: string);
  end;

  ESSConfigurationExists = class(ESSException)
  public
    constructor Create(const AConfigurationName: string);
  end;

  ESSObjectNotFound = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName, AObjectName: string);
  end;

  ESSObjectNameIsNull = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName: string);
  end;

  ESSDatabaseDeleteExcpetion = class(ESSException)
  public
    constructor Create(const AErrorClassName, AErrorFunctionName, AErrorMessage: string);
  end;

implementation

{ ESSOperationException }

constructor ESSOperationException.Create(const AErrorClassName, AErrorFunctionName, AErrorMessage: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur error: '#10 + AErrorMessage);
end;

{ ESSClassNotFound }

constructor ESSClassNotFound.Create(const AErrorClassName, AErrorFunctionName, AClassName: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur error: '#10'Class ''' + AClassName + ''' not found.');
end;

{ ESSClassExists }

constructor ESSClassExists.Create(const AErrorClassName, AErrorFunctionName, AClassName: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur error: '#10'Class ''' + AClassName + ''' exists.');
end;

{ ESSConfigurationNotFound }

constructor ESSConfigurationNotFound.Create(const AConfigurationName: string);
begin
  inherited Create('Configuration ''' + AConfigurationName + ''' not found.');
end;

{ ESSObjectNotFound }

constructor ESSObjectNotFound.Create(const AErrorClassName, AErrorFunctionName, AObjectName: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur error: '#10'Object ''' + AObjectName + ''' not found.');
end;

{ ESSObjectNameIsNull }

constructor ESSObjectNameIsNull.Create(const AErrorClassName, AErrorFunctionName: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur error: '#10'Object name is null.');
end;

{ ESSDatabaseDeleteExcpetion }

constructor ESSDatabaseDeleteExcpetion.Create(const AErrorClassName, AErrorFunctionName, AErrorMessage: string);
begin
  inherited Create(AErrorClassName + '.' + AErrorFunctionName + ' occur Delete error : '#10 + AErrorMessage);
end;

{ ESSConfigurationExists }

constructor ESSConfigurationExists.Create(const AConfigurationName: string);
begin
  inherited Create('Configuration ''' + AConfigurationName + ''' exists.');
end;

end.
